package com.test.log;


/**
 * 
 * temp
 * 
 *
 */
public class LogUtil
{
	private static int  g_Tag = 0 ;
	
	public static long begin = 0;
	public static long end = 0;

	
	
	/**
	 * desp：
	 */
	public static void printTime(int tag)
	{
		System.out.println("time" +"\t"+ "tag_"+tag+"="+System.currentTimeMillis());
	}
	
	/**
	 * 
	 * desp：
	 *@param tag_s string or null
	 */
	public static void printSpan(String tag_s)
	{
		long tag = g_Tag ;
		
		if(begin == 0){
			System.out.println("time"+"\t"+"must set begin prameter");
			return ;
		}
		end = System.currentTimeMillis();
		if(tag_s == null || "".equals(tag_s)){
			System.out.println("time"+"\t"+"tag_"+tag+"="+end);
			System.out.println("time"+"\t"+"tag_"+tag+"="+(end - begin));
			
		}else{
			System.out.println("time"+"\t"+tag_s+"tag_"+tag+"="+end);
			System.out.println("time"+"\t"+tag_s+"tag_"+tag+"="+(end - begin));
		}
	
		g_Tag ++ ;
		begin = end ; 		
	}
	
	/**
	 * desp：
	 *@param args
	 */
	public static void main(String[] args)
	{
		// TODO Auto-generated method stub

	}

}
